<?php
/**
 * Created by PhpStorm.
 * User: admin
 * Date: 2018/4/29
 * Time: 17:18
 */
require('../common.inc.php');
define('SEJUJOPEFDNGJSL',1);
require_once ('../include/common.db.php');

set_time_limit(0);// 通过set_time_limit(0)可以让程序无限制的执行下去
ini_set('memory_limit','512M'); // 设置内存限制

global $db;
$time = time();
$page = 1;
$number =1000;
$sql = "select count(*) as total  from ld_user_account where status_time < {$time} ";
$db->query($sql,2);
$total =   $db->rs;
$pageToal =  ceil($total['total']/$number);

global $db;
$list = "'allowtxall','teams1','teams2','teams3','teams4','teams5','recnum','limitmax'";
$sql = "select * from ld_settings where setting_enname in({$list})";
$db->query($sql);
//配置
$set_config =$db->rs;

$data['s1'] =getAccrual($set_config,1); //日利息
$data['s2'] =getAccrual($set_config,2); //团队利息
$data['s3'] =getAccrual($set_config,3); //团队推荐人最少持有数
$data['s4'] =getAccrual($set_config,4); //最大上限收益
while ( $page <= $pageToal){
    //发放所有利息
    auto_accrual($page,$number,$time,$data);
    $page++;
}
